/**
 * 
 */
package com.manolo.component.desing;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

/**
 * @author gustavo
 *
 */
public class UtilImage {

	public static BufferedImage loadImage(String path) throws IOException{
			return ImageIO.read(new File(path) );
	}
	
	public static void operationBlit(BufferedImage originalImage, Graphics2D g2d, int destinationX,int destinationY, int columnNumber, int area, int width, int height){
		int coordX = (area % columnNumber) * width;
		int coordY = (area % columnNumber) * height;
		g2d.drawImage(originalImage,destinationX,destinationY,destinationX+width,destinationY+height,coordX,coordY,coordX+width,coordY+height,null);
		
	}
	
}
